package com.qs.mall.controller.api.impl;

import com.qs.mall.controller.api.ProductFeignClient;
import com.qs.mall.dto.Product;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class ProductFeignClientCallBack implements ProductFeignClient {

    private static final Logger logger = LoggerFactory.getLogger(ProductFeignClientCallBack.class);

    @Override
    public Product findById(Long productId) {
        logger.info("feign远程调用失败，执行熔断降级方法。。");
        Product product = new Product();
        product.setProductDesc("熔断：触发降级方法");
        return product;
    }
}
